import { UserService } from './../../providers/UserService';
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams,AlertController } from 'ionic-angular';

/**
 * Generated class for the RefundPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-refund',
  templateUrl: 'refund.html',
})
export class RefundPage {

  show:boolean=false;
  Outmonry={
    shop_id:'',
    withdraw_type:1,
    withdraw_account:''


  }
  constructor(public navCtrl: NavController, public navParams: NavParams,public UsServer:UserService,public alertCtrl: AlertController) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad RefundPage');
  }
GoMc(){
  this.show=true
}
OutMc(){
  this.show=false
}
async OutMoney(){
let shop=localStorage.getItem('userinfo')
let ShopUser= JSON.parse(shop)
this.Outmonry.shop_id=ShopUser['shop_id']
this.Outmonry. withdraw_account=ShopUser['user_phone'];
const mgs=await this.UsServer.refundBondAPI(this.Outmonry);
if(mgs.code==0){
  console.log(mgs.msg);
 
  let alert = this.alertCtrl.create({
    title: '提示!',
    subTitle: mgs.msg,
    buttons: ['确定']
  });
  alert.present();

}
// console.log(mgs)
// console.log(this.Outmonry)

}
}
